/*
* Copyright (c) 18/5/1 foo.com. All Rights Reserved.
*/
package com.cgmnx.admin.model.enums;

import com.cgmnx.admin.common.enums.EnumTrait;

/**
 * @author: z Date: 18/5/1 Time: 下午2:05
 * @version: 1.0.0
 */
public enum NodeAuditStatus implements EnumTrait {

    UN_AUDIT(0, "未审核"),
    AUDITED(1, "审核通过"),
    DELETED(2, "已删除");

    private int code;
    private String desc;

    NodeAuditStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static NodeAuditStatus codeOf(int code) {
        for (NodeAuditStatus status : NodeAuditStatus.values()) {
            if (status.code == code) {
                return status;
            }
        }

        return null;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


}